var express=require('express');
var router=express.Router();
var config=require('./../../config/config.js');

// logger.info('this is king coming');
router.get('/',function(req,res,next){
	var MongoClient=require('mongodb').MongoClient;
	var mongodbHost=config.getMongodbHost();
	var mongodbDb=config.getMongodbDb();
	var mongodbUrl='mongodb://'+mongodbHost+'/'+mongodbDb;
	MongoClient.connect(mongodbUrl,function(err,db){
		db.collection('user').insert({name:1},function(err,data){
			console.log(err);
			console.log(data);
			logger=require('./../../config/express.js').logger();
			console.log(logger);
			logger.info('this is --log4js.log');
			res.sendfile('public/index.html');
			db.close();
		});
	});
});

module.exports=router;